<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdsSpaceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ads_space', function (Blueprint $table) {
            $table->increments('id')->comment('自增ID');
            $table->string('name', 50)->default('')->comment('广告位名称');
            $table->string('id_name', 100)->default('')->comment('标识，英文字母命名且不可重复，前台调用数据标识');
            $table->unsignedTinyInteger('type')->default('0')->comment('类型，数据字典');
            $table->string('width', 20)->default('0')->comment('宽度，单位：像素');
            $table->string('height', 20)->default('0')->comment('高度，单位：像素');
            $table->string('description', 200)->default('')->comment('描述');
            $table->tinyInteger('status')->default(1)->comment('发布状态，0未发布，1已发布 ，数据字典');
            $table->unsignedInteger('created_user_id')->default('0')->comment('管理员ID');
            $table->timestamp('created_at')->nullable()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ads_space');
    }
}
